package com.crm.model.pojo;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the contact database table.
 * 
 */
@Entity
@Table(name="contact")
@NamedQuery(name="Contact.findAll", query="SELECT c FROM Contact c")
public class Contact implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private String tid;

	private String temail;

	private String tkind;

	private String tname;

	private String tpho;

	private String ttel;

	//bi-directional many-to-one association to Actionhistory
	@OneToMany(mappedBy="contact")
	private List<Actionhistory> actionhistories;

	//bi-directional many-to-one association to Customer
	@ManyToOne
	@JoinColumn(name="tcid")
	private Customer customer;

	//bi-directional many-to-one association to Guanhuaicc
	@OneToMany(mappedBy="contact")
	private List<Guanhuaicc> guanhuaiccs;

	//bi-directional many-to-one association to Weixiuonac
	@OneToMany(mappedBy="contact")
	private List<Weixiuonac> weixiuonacs;

	public Contact() {
	}

	public String getTid() {
		return this.tid;
	}

	public void setTid(String tid) {
		this.tid = tid;
	}

	public String getTemail() {
		return this.temail;
	}

	public void setTemail(String temail) {
		this.temail = temail;
	}

	public String getTkind() {
		return this.tkind;
	}

	public void setTkind(String tkind) {
		this.tkind = tkind;
	}

	public String getTname() {
		return this.tname;
	}

	public void setTname(String tname) {
		this.tname = tname;
	}

	public String getTpho() {
		return this.tpho;
	}

	public void setTpho(String tpho) {
		this.tpho = tpho;
	}

	public String getTtel() {
		return this.ttel;
	}

	public void setTtel(String ttel) {
		this.ttel = ttel;
	}

	public List<Actionhistory> getActionhistories() {
		return this.actionhistories;
	}

	public void setActionhistories(List<Actionhistory> actionhistories) {
		this.actionhistories = actionhistories;
	}

	public Actionhistory addActionhistory(Actionhistory actionhistory) {
		getActionhistories().add(actionhistory);
		actionhistory.setContact(this);

		return actionhistory;
	}

	public Actionhistory removeActionhistory(Actionhistory actionhistory) {
		getActionhistories().remove(actionhistory);
		actionhistory.setContact(null);

		return actionhistory;
	}

	public Customer getCustomer() {
		return this.customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	public List<Guanhuaicc> getGuanhuaiccs() {
		return this.guanhuaiccs;
	}

	public void setGuanhuaiccs(List<Guanhuaicc> guanhuaiccs) {
		this.guanhuaiccs = guanhuaiccs;
	}

	public Guanhuaicc addGuanhuaicc(Guanhuaicc guanhuaicc) {
		getGuanhuaiccs().add(guanhuaicc);
		guanhuaicc.setContact(this);

		return guanhuaicc;
	}

	public Guanhuaicc removeGuanhuaicc(Guanhuaicc guanhuaicc) {
		getGuanhuaiccs().remove(guanhuaicc);
		guanhuaicc.setContact(null);

		return guanhuaicc;
	}

	public List<Weixiuonac> getWeixiuonacs() {
		return this.weixiuonacs;
	}

	public void setWeixiuonacs(List<Weixiuonac> weixiuonacs) {
		this.weixiuonacs = weixiuonacs;
	}

	public Weixiuonac addWeixiuonac(Weixiuonac weixiuonac) {
		getWeixiuonacs().add(weixiuonac);
		weixiuonac.setContact(this);

		return weixiuonac;
	}

	public Weixiuonac removeWeixiuonac(Weixiuonac weixiuonac) {
		getWeixiuonacs().remove(weixiuonac);
		weixiuonac.setContact(null);

		return weixiuonac;
	}

}